﻿@model NextInventory.Model.Party.PartyModel

@{
    ViewBag.Title = "Add Party";
    Dictionary<string, int> ModeOfPayment = new Dictionary<string, int>();
    ModeOfPayment.Add(NextInventory.Common.ModeOfPayment.Cash.ToString(), 1);
    ModeOfPayment.Add(NextInventory.Common.ModeOfPayment.Credit.ToString(), 2);
    ModeOfPayment.Add(NextInventory.Common.ModeOfPayment.Cheque.ToString(), 3);


    Dictionary<string, int> PartStatus = new Dictionary<string, int>();
    PartStatus.Add(NextInventory.Common.PartyStatus.Customer.ToString(), 1);
    PartStatus.Add(NextInventory.Common.PartyStatus.Supplier.ToString(), 2);
    PartStatus.Add(NextInventory.Common.PartyStatus.Customer_Supplier.ToString(), 3);
    //return new SelectList(list, "Value", "Text", list.FirstOrDefault());
}

@using (Html.BeginForm("Create", "Party", FormMethod.Post))
{
    @Html.ValidationSummary(false)

    <table border="0" cellpadding="0" cellspacing="0" id="id-form">
        <tr>
            <th>
                @Html.LabelFor(model => model.FirstName)
            </th>
            <td>
                @Html.TextBoxFor(model => model.FirstName, new { @class = "inp-form" })
                @Html.ValidationMessageFor(model => model.FirstName)
            </td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.LastName)
            </th>
            <td>@Html.TextBoxFor(model => model.LastName, new { @class = "inp-form" })
                @Html.ValidationMessageFor(model => model.LastName)</td>
        </tr>
        <tr>
            <th>@Html.LabelFor(model => model.Phone)</th>
            <td>@Html.TextBoxFor(model => model.Phone, new { @class = "inp-form" })
                @Html.ValidationMessageFor(model => model.Phone)</td>
        </tr>
        <tr>
            <th>@Html.LabelFor(model => model.Email)</th>
            <td>@Html.TextBoxFor(model => model.Email, new { @class = "inp-form" })
                @Html.ValidationMessageFor(model => model.Email)</td>
        </tr>
        <tr>
            <th>@Html.LabelFor(model => model.Address)</th>
            <td>@Html.TextBoxFor(model => model.Address, new { @class = "inp-form" })
                @Html.ValidationMessageFor(model => model.Address)</td>
        </tr>
        <tr>
            <th>@Html.LabelFor(model => model.City)</th>
            <td>@Html.TextBoxFor(model => model.City, new { @class = "inp-form" })
                @Html.ValidationMessageFor(model => model.City)</td>
        </tr>
        <tr>
            <th>@Html.LabelFor(model => model.Country)</th>
            <td>@Html.TextBoxFor(model => model.Country, new { @class = "inp-form" })
                @Html.ValidationMessageFor(model => model.Country)</td>
        </tr>
        <tr>
            <th>@Html.LabelFor(model => model.CreditLimit)</th>
            <td>@Html.TextBoxFor(model => model.CreditLimit, new { @class = "inp-form" })
                @Html.ValidationMessageFor(model => model.CreditLimit)</td>
        </tr>
        <tr>
            <th>@Html.LabelFor(model => model.ModeOfPaymentId)</th>
            <td>@Html.DropDownListFor(model => model.ModeOfPaymentId, new SelectList(ModeOfPayment, "Value", "Key"), "Select mode of payment", new { @class = "styledselect_form_1" })
                @Html.ValidationMessageFor(model => model.ModeOfPaymentId)</td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.PartyStatusId)
            </th>
            <td>
                @Html.DropDownListFor(model => model.PartyStatusId, new SelectList(PartStatus, "Value", "Key"), "Select party status", new { @class = "styledselect_form_1" })
                @Html.ValidationMessageFor(model => model.PartyStatusId)
            </td>
        </tr>
        <tr>
            <th></th>
            <td>
                <input type="submit" value="" class="form-submit" />
                <input type="reset" value="" class="form-reset" />
            </td>
        </tr>
    </table>
}